package com.controller;

import com.configProperty.WiselySettings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by pengfei on 16/6/14.
 */
@SpringBootApplication
@Controller
@EnableConfigurationProperties({WiselySettings.class})
public class HandlebarController {
    @Autowired
    WiselySettings wiselySettings ;
    @Value("${zcy.mybank.db.dbname:1}")
    private String test;
    @Value("${random.long}")
    private long rlong;
    @Autowired
    Environment environment;
    @Value("${spring.application.name}")
    private String port;

    @RequestMapping
    @ResponseBody
    public String doPost(){
//        System.out.println(wiselySettings.getName()+" - "+wiselySettings.getGender());
        System.out.println(test);
//        System.out.println("------\n");
//        System.out.println(rlong);
       return "xxxxxx";
    }


    @RequestMapping("/a/b")
    @ResponseBody
    public String doPost1(){
        return "rrrrrrrr";
    }



    public static void main(String[] args) {
        SpringApplication.run(com.controller.HandlebarController.class, args);
    }

}
